Skip to content

Add Home Assistant provider - #1

Merged
canuto merged 1 commit into
mainfrom
feature/homeassistant-provider
Jan 19, 2026
Merged

Add Home Assistant provider#1
canuto merged 1 commit into
mainfrom
feature/homeassistant-provider

Conversation

@canuto

@canuto canuto commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds Home Assistant as a supported webhook provider
  • Uses token comparison via X-HA-Secret header (same pattern as GitLab)
  • Secure constant-time comparison prevents timing attacks

Changes

File Description
src/providers/homeassistant.ts New provider implementation
src/providers/index.ts Register provider
src/types.ts Add to Provider type
src/headers.ts Add header extraction
package.json Add keywords
README.md Add to provider table + usage example

Usage

import { verify } from 'webhook-verify';

// Verify Home Assistant webhook
const isValid = verify('homeassistant', req.rawBody, req.headers, process.env.HA_SHARED_SECRET);

Home Assistant Configuration

rest_command:
  send_event:
    url: "https://your-webhook.com/ha/event"
    method: POST
    headers:
      X-HA-Secret: !secret webhook_secret
    content_type: "application/json"
    payload: '{"entity_id": "{{ entity_id }}", "state": "{{ state }}"}'

Test plan

  • Build succeeds: npm run build
  • Tests pass: npm test
  • Verify token comparison works with valid secret
  • Verify token comparison fails with invalid secret

🤖 Generated with Claude Code

Adds support for Home Assistant webhook verification using the X-HA-Secret
header token comparison pattern (same as GitLab).

Home Assistant's rest_command integration sends a shared secret via header,
which is validated using constant-time comparison to prevent timing attacks.

Example Home Assistant configuration:
```yaml
rest_command:
  send_event:
    url: "https://your-webhook.com/ha/event"
    headers:
      X-HA-Secret: !secret webhook_secret
```

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@canuto
canuto merged commit 589af07 into main Jan 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant